// Fill out your copyright notice in the Description page of Project Settings.

#pragma once

#include "CoreMinimal.h"
#include "Tickable.h"

class IOssTaskTick 
{
public:
	virtual FString GetTaskID()const = 0;

	virtual void TickTask(const  float& DeltaTime) = 0;

};


//int GameThread call  ProgressCallBack tool
class FOssTaskTickMag :public FTickableGameObject
{
private:

	static FOssTaskTickMag* tickkMag;
	FCriticalSection Mutex;
	TArray<IOssTaskTick*> taskList;

	FOssTaskTickMag();
	~FOssTaskTickMag();
	FOssTaskTickMag(FOssTaskTickMag&) = delete;
	FOssTaskTickMag& operator=(const FOssTaskTickMag&) = delete;

public:

	void AddTask(IOssTaskTick* task);
	void RemoveTask(IOssTaskTick* task);

	// int GameThread call  ProgressCallBack
	virtual void Tick(float DeltaTime) override;;

	virtual TStatId GetStatId() const override;


	static FOssTaskTickMag* GetTickMag();

};